const playerAction = process.argv[2];
console.log(playerAction);
if (playerAction != 'rock' && playerAction != 'scissors' && playerAction != 'paper') {
    console.log('请输入rock/scissors/paper');

} else {
    const arr = ['rock', 'scissors', 'paper']
    const computerAction = arr[Math.floor(Math.random() * 3)];
    console.log('你出的是：' + playerAction);
    console.log('电脑出的是：' + computerAction);
    if (playerAction === computerAction) {
        console.log('平局');
    } else if ((playerAction === 'rock' && computerAction === 'scissors') || (playerAction === 'scissors' && computerAction === 'paper') || (playerAction === 'paper' && computerAction === 'rock')) {
        console.log('你赢了');
    } else {
        console.log('你输了');
    }
}
